package com.mdd.admin.service.system.impl;

import com.mdd.admin.service.system.ISystemPointDeductionConfigService;
import com.mdd.admin.validate.system.SystemPointDeductionConfingParam;
import com.mdd.common.utils.LsConfigUtil;
import org.springframework.stereotype.Service;

@Service
public class SystemPointDeductionConfigServiceImpl implements ISystemPointDeductionConfigService {

    /**
     * 新增或更新 积分抵扣规则
     *
     * @author panweiliang
     * @param systemPointDeductionConfingParam 参数
     */
    @Override
    public void addOrUpdate(SystemPointDeductionConfingParam systemPointDeductionConfingParam) {
        LsConfigUtil.set("point_deduction", "enable", String.valueOf(systemPointDeductionConfingParam.getEnable()));
        LsConfigUtil.set("point_deduction", "scale", String.valueOf(systemPointDeductionConfingParam.getScale()));
        LsConfigUtil.set("point_deduction", "lower_limit", String.valueOf(systemPointDeductionConfingParam.getLower_limit()));
        LsConfigUtil.set("point_deduction", "superior_limit", String.valueOf(systemPointDeductionConfingParam.getSuperior_limit()));
    }
}
